<extend name="./app/Tpl/Public/template.html" />
<block name="content_body">
	<div class="pad-lr-10">
	    <div style="padding:10px; overflow:hidden;">
	    	<div class="main_top" style="clear:both;"><h4>温馨提示：</h4>
    			<ul>
    				<li class="green">1.所在区域：沙河口区，高新园区等</li>
    				<li class="green">2.供货说明：粮油  冰露 等产品分类或具体产品名称 </li>
    			</ul>
	    	</div>
	    </div>
	    <form name="form_edit" id="form_edit" action="{:U('doAdd')}" method="post">
	        <table width="100%" cellpadding="2" cellspacing="1" class="table_form">
	            <tr>
	                <th width="100"><span class="required">*</span>供应商:</th>
	                <td width="300">
	                	<input type="text" name="title" id="title" class="input-text-long" value="">
	                </td>
	                <td><div id="titleTip"></div></td>
	            </tr>	            
	            <tr>
	                <th><span class="required">*</span>所在城市:</th>
	                <td>
	                	<input type="text" name="city" id="city" class="input-text-long" value="大连">
	                </td>
	                <td><div id="cityTip"></div></td>
	            </tr>
	            <tr>
	                <th><span class="required">*</span>所在区域:</th>
	                <td>
	                	<input type="text" name="district" id="district" class="input-text-long" value="">
	                </td>
	                <td><div id="districtTip"></div></td>
	            </tr>
	            <tr>
	                <th><span class="required">*</span>详细地址:</th>
	                <td>
	                	<input type="text" name="address" id="address" class="input-text-long" value="">
	                </td>
	                <td><div id="addressTip"></div></td>
	            </tr>
	            <tr>
	                <th><span class="required">*</span>联系方式:</th>
	                <td>
	                	<input type="text" name="link_way" id="link_way" class="input-text-long" value="">
	                </td>
	                <td><div id="link_wayTip"></div></td>
	            </tr>
	            <tr>
	                <th><span class="required">*</span>联系人:</th>
	                <td>
	                	<input type="text" name="link_man" id="link_man" class="input-text-long" value="">
	                </td>
	                <td><div id="link_manTip"></div></td>
	            </tr>
	            <tr>
	            	<th width="100"><span class="required">*</span>供货说明:</th>
	                <td >
	                	<textarea id="content" name="content" cols="30" rows="10"></textarea>
	                </td>
	                <td></td>
	            </tr>
	            <tr>
		            <td colspan="3">
			            <div class="explain-col">
			            	<input type="button" name="submitBtn" value="创建" onclick="doSubmit()">
	        				<input type="button" name="reset" value="返回列表" onclick='redirect("{:U('index')}")'>
			        	</div>
		            </td>
	            </tr>
	        </table>
	    </form>
	</div>
<script type="text/javascript" src="__ROOT__/statics/scripts/kindeditor/kindeditor-all-min.js"></script>
<script type="text/javascript">

function doSubmit(){
	$('#form_edit').submit();
}
$(function(){
	
	$.formValidator.initConfig({
		formID:"form_edit",
		wideWord:false,
		submitOnce:true
	});
	
	var tips = {
		"titleTip":"请输入供应商名称",
		"cityTip":"请输入所在城市",
		"districtTip":"请选择供应商所在区域",
		"addressTip":"请输入供应商地址",
		"link_wayTip":"请输入联系方式",
		"link_manTip":"请输入联系人",
	}
	$("#title").formValidator({
		onFocus:tips.titleTip,
	}).inputValidator({
		min:2,
		max:50,
		onError:"请输入2-50个汉字或字符"
	})
	
	$("#city").formValidator({
		onFocus:tips.cityTip,
	}).inputValidator({
		min:2,
		max:50,
		onError:"城市信息不正确（2-50个字符）"
	});
	
	$("#district").formValidator({
		onFocus:tips.districtTip,
	}).inputValidator({
		min:2,
		max:50,
		onError:"区域信息不正确（2-50个字符）"
	});
	
	
	$("#address").formValidator({
		onFocus:tips.addressTip,
	}).inputValidator({
		min:2,
		max:100,
		onError:"详细地址不正确（2-50个字符）"
	});
	
	$("#link_man").formValidator({
		onFocus:tips.link_manTip,
	}).inputValidator({
		min:2,
		max:50,
		onError:"店长信息不正确"
	});
	
	$("#link_way").formValidator({
		onFocus:tips.link_wayTip,
	}).inputValidator({
		min:8,
		max:100,
		onError:"联系方式不正确"
	});
	
		
})

</script>
</block>	